package org.springblade.modules.repair.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.repair.entity.MaintainMsg;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.repair.vo.MaintainMsgVO;
import org.springblade.modules.repair.vo.MsgTypeVO;

import java.util.List;

public interface MaintainMsgService extends BaseService<MaintainMsg> {

	/**
	 * 发送 web 端消息
	 * @param msg
	 */
	void sendWebMsg(MaintainMsg msg, List<Long> userIds);

	List<MsgTypeVO> listMsgType();

	IPage<MaintainMsgVO> selectMsgPage(String keyword,String typeIds, Integer status, Integer bType, IPage<MaintainMsgVO> page);

	Boolean readBath(List<Long> typeIds, Long userId);

	Boolean read(Long id, Long userId);

	/**
	 * 发送平台消息
	 *
	 * @param msg {
	 *            "title": "标题",
	 *            "content": "内容",
	 *            "type": 消息类型,
	 *            "otherId": 关联业务表id
	 *            }
	 */
	Long sendMsg(MaintainMsg msg,List<Long> userIds,String tenantId);

	Boolean readAll(Long userId);
}
